package com.sayyi.demo.async;

import com.sayyi.demo.retry.RetryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class AsyncService {

    @Autowired
    private RetryService retryService;

    @Async
    public void asyncMethod(String message) {
        log.info("async method invoked: {}", message);
        // 异步调用可重试方法
        retryService.invoke();
    }
}
